Skip to content

Group21 submisssion#1

Open
nguyenhuy0206 wants to merge 9 commits intominhhuy020604:mainfrom
nguyenhuy0206:main
Open

Group21 submisssion#1
nguyenhuy0206 wants to merge 9 commits intominhhuy020604:mainfrom
nguyenhuy0206:main

Conversation

@nguyenhuy0206
Copy link
Copy Markdown

1. Best-Fit Decreasing (BFD) Heuristic

Overview:

The BFD algorithm is a greedy heuristic aimed at minimizing the waste generated during the allocation of items into containers (stocks). It prioritizes items with larger areas and attempts to place them in the best-fitting available container to reduce unused space.

Steps:

  1. Sorting Products:

    • Products are sorted in descending order based on their area (width × height).
    • This ensures that larger items, which are harder to place, are considered first.
  2. Searching for Placement:

    • For each product, the algorithm iterates through all available containers (stocks).
    • It evaluates both possible orientations (rotations) of the product to check for a better fit.
    • Within each container, every possible position is checked to see if the product can fit without overlapping existing items or exceeding container boundaries.
  3. Evaluating Fit:

    • A waste metric is calculated for each potential placement. Waste is defined as the difference between the area of the container and the area of the product.
    • The position with the least waste is selected as the best fit.
  4. Placement Decision:

    • If a valid position is found, the product is placed, and the stock layout is updated.
    • If no position is found across all containers, the algorithm fails to place the item.

Advantages:

  • Simple to implement and computationally efficient.
  • Ensures items are placed in containers with minimal unused space.

Limitations:

  • As a purely local optimization method, it may lead to suboptimal global solutions.
  • It might fail to consider future items when prioritizing the current item, leading to higher overall waste.

2. Heuristic Shelf Allocation (HSA)

Overview:

The HSA algorithm builds on the BFD approach by introducing the concept of shelves to better organize space within containers. Shelves help segregate the stock into manageable regions, making placement decisions more structured and potentially reducing trim loss.

Steps:

  1. Sorting Products:

    • Similar to BFD, products are sorted in descending order based on their area.
  2. Shelf Management:

    • Each container maintains a list of active shelves.
    • A shelf is defined by its vertical position (y-coordinate) and height, extending across the full width of the container.
    • New shelves are created dynamically when no existing shelf can accommodate the current product.
  3. Searching for Placement:

    • For each product, the algorithm first tries to fit the product into an existing shelf.
    • It considers both orientations of the product and evaluates all positions within each shelf to find the one with the least waste.
    • If no suitable shelf is found, the algorithm considers the entire container area to find a placement.
    • If the product is placed outside of an existing shelf, a new shelf is created at the placement's position.
  4. Evaluating Fit:

    • Similar to BFD, the algorithm uses a waste metric to determine the best fit.
  5. Placement Decision:

    • The product is placed in the best available position, and the stock layout is updated.
    • If placed outside of a shelf, the shelf list for the container is updated to include the new shelf.

Advantages:

  • Reduces fragmentation by organizing container space into structured shelves.
  • Improves placement efficiency for smaller products by leveraging shelves.

Limitations:

  • Slightly more computationally expensive due to additional management of shelves.
  • May still lead to suboptimal results when future product placements are not considered.

Comparison of BFD and HSA

Aspect Best-Fit Decreasing (BFD) Heuristic Shelf Allocation (HSA)
Key Feature Greedy placement based on minimizing waste. Introduces shelves to organize space.
Complexity Lower, as it evaluates the entire stock directly. Higher, due to shelf management overhead.
Trim Loss Higher, as it may leave irregular gaps. Lower, due to structured organization.
Flexibility Simple and effective for uniform items. More suitable for varied product sizes.
Global Optimality Relies solely on local decisions. Improves global efficiency by reducing fragmentation.

Applications and Suitability

  1. BFD:

    • Suitable for scenarios where simplicity and speed are critical.
    • Works well when product sizes are similar and containers are large enough.
  2. HSA:

    • Ideal for scenarios with varied product sizes and high container utilization requirements.
    • Particularly effective in reducing trim loss when smaller items are frequent.

Let me know if you'd like me to expand on any specific section or focus on a particular aspect for your report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant